package weborb.gcf.command
{
	import com.adobe.cairngorm.commands.ICommand;
	import com.adobe.cairngorm.control.CairngormEvent;
	
	import mx.controls.Alert;
	import mx.rpc.IResponder;
	import mx.rpc.events.FaultEvent;
	
	import weborb.gcf.business.*;
	import weborb.gcf.model.ModelLocator;
    
    public class InfoService_getInfoCommand implements ICommand, IResponder
    {
	    public function execute( event : CairngormEvent) : void
	    {
			var delegate : InfoServiceDelegate = new InfoServiceDelegate( this );
			delegate.getInfo();
	    }
	
	    public function result( event : Object ) : void
	    {
			var returnValue:String = event.result as String;
			// Update Data Model
			var model:ModelLocator = ModelLocator.getInstance();
			model.infoServer = returnValue;
	    }
	
	    public function fault( event : Object ) : void
	    {
			var faultEvent : FaultEvent = FaultEvent( event );
			Alert.show( faultEvent.fault.faultString);
	    }
    }
}